package app.common.dao;
import java.util.ArrayList;
import java.util.List;

import cn.lily.com.container.data.Record;
import cn.lily.com.exception.YaconException;
import cn.lily.esb.framework.drivers.db.bean.ControlDAO;
public class Leo_tag_typ_relaBean extends ControlDAO implements Cloneable {
	private static final long serialVersionUID = 1L;
	public Leo_tag_typ_relaBean() throws YaconException {
		super();
		setTableName("LEO_TAG_TYP_RELA");
	}
	String  ftag_id;
	String  ftag_typ_id;

	public void setTag_id( String tag_id)throws YaconException{
		setFieldData("tag_id",tag_id,TEXT);
		this.ftag_id=tag_id;
	}

	public String getTag_id(){
		if ( this.ftag_id == null){
			return "";
		}
		else {
			return this.ftag_id;
		}
	}

	public void setTag_typ_id( String tag_typ_id)throws YaconException{
		setFieldData("tag_typ_id",tag_typ_id,TEXT);
		this.ftag_typ_id=tag_typ_id;
	}

	public String getTag_typ_id(){
		if ( this.ftag_typ_id == null){
			return "";
		}
		else {
			return this.ftag_typ_id;
		}
	}

	public  List<Leo_tag_typ_relaBean> findListBeans(String sSqlWhere)throws YaconException {
		List<Leo_tag_typ_relaBean> listBeans = new ArrayList<Leo_tag_typ_relaBean>();
		findTable = findTableByWhere(sSqlWhere);
		while (findTable.next())
		{
			Leo_tag_typ_relaBean fDaoBean  = new Leo_tag_typ_relaBean();
			fDaoBean.ftag_id = findTable.getString("tag_id");
			fDaoBean.ftag_typ_id = findTable.getString("tag_typ_id");
			fDaoBean.operate_mode = "edit";
			listBeans.add(fDaoBean);
		}
		return listBeans;
	}

	public Leo_tag_typ_relaBean findBean(String sSqlWhere)throws YaconException {
		findTable = findTableByWhere(sSqlWhere);
		if (findTable.next())
		{
			Leo_tag_typ_relaBean fDaoBean  = new Leo_tag_typ_relaBean();
			fDaoBean.ftag_id = findTable.getString("tag_id");
			fDaoBean.ftag_typ_id = findTable.getString("tag_typ_id");
			fDaoBean.operate_mode = "edit";
			return fDaoBean;
		}else
			return null;
	}

	public void setViewRecord(Record viewRecord) throws YaconException{
		if (viewRecord.getString("tag_id") != null)
			setTag_id(viewRecord.getString("tag_id"));
		if (viewRecord.getString("tag_typ_id") != null)
			setTag_typ_id(viewRecord.getString("tag_typ_id"));
	}

}
